
// eslint-disable-next-line no-undef
const commonFiles = hotRequire.context('./common', false, /\.js$/)
// eslint-disable-next-line no-undef
const h5Files = hotRequire.context('./h5', false, /\.js$/)
// eslint-disable-next-line no-undef
const wechatFiles = hotRequire.context('./wechat', false, /\.js$/)

const modules = []
commonFiles.keys().forEach((key) => {
  const item = commonFiles(key)
  modules.push(...item)
})
if (process.env.UNI_PLATFORM === 'h5') {
  h5Files.keys().forEach((key) => {
    const itemH5 = h5Files(key)
    modules.push(...itemH5)
  })
} else if (process.env.UNI_PLATFORM === 'mp-weixin') {
  wechatFiles.keys().forEach((key) => {
    const itemWeChat = wechatFiles(key)
    modules.push(...itemWeChat)
  })
}

module.exports = modules
